package assign2;

/**
 * Rectangle - A rectangle with integer dimensions.
 * 
 * @author
 * @email
 * @date
 */
public class Rectangle {

	// Private components:

	private int length;
	private int width;

	// Constructors:

	/**
	 * Create a new Rectangle with the specified length and width. Length and
	 * width must be non-negative.
	 */
	public Rectangle(int length, int width) {
		this.length = length;
		this.width = width;
	}

	// Queries:

	/**
	 * The length of this Rectangle.
	 */
	public int length() {
		return length;
	}

	/**
	 * The width of this Rectangle.
	 */
	public int width() {
		return width;
	}

	/**
	 * The area of this Rectangle.
	 */
	public int area() {
		return length * width;
	}

	/**
	 * The perimeter of this Rectangle.
	 */
	public int perimeter() {
		return 2 * length + 2 * width;
	}

}
